﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SAC.sqlHelper;

namespace Bussiness
{
    public class KBS
    {
        string errMsg = "";

        /// <summary>
        /// 报警描述
        /// </summary>
        public string AlarmDESC { get; set; }
        /// <summary>
        /// 相关描述
        /// </summary>
        public string RelationDESC { get; set; }
        /// <summary>
        /// 测点值
        /// </summary>
        public string PIValue { get; set; }
        /// <summary>
        /// 指导意见
        /// </summary>
        public string Operation { get; set; }
        /// <summary>
        /// 报警指导意见
        /// </summary>
        /// <returns></returns>
        public System.Data.DataTable GetAlarm()
        {
            string sql = "SELECT * FROM T_ALARM_KBS ORDER BY 指导意见";
            //DB2Provider.DataLink link = new DB2Provider.DataLink();
            System.Data.DataTable dt = new System.Data.DataTable();
            dt = DBsql.RunDataTable(sql, out errMsg);
            //link.ExcuteRetureTable(sql);

            return dt;
        }
        /// <summary>
        /// 报警指导意见
        /// </summary>
        /// <returns></returns>
        public System.Data.DataTable GetAlarm(string paraID)
        {
            string sql = "SELECT * FROM T_ALARM_KBS WHERE 测点号='" + paraID + "' ORDER BY 指导意见";
            //DB2Provider.DataLink link = new DB2Provider.DataLink();
            System.Data.DataTable dt = new System.Data.DataTable();
            dt = DBsql.RunDataTable(sql, out errMsg);// link.ExcuteRetureTable(sql);

            return dt;
        }
        /// <summary>
        /// 返回测点号
        /// </summary>
        /// <param name="catalog"></param>
        /// <returns></returns>
        public System.Data.DataTable GetAlarmInfo(string catalog)
        {
            string sql = "SELECT 测点号 FROM T_ALARM_INFO WHERE 类别='" + catalog + "'";
            //DB2Provider.DataLink link = new DB2Provider.DataLink();
            return DBsql.RunDataTable(sql, out errMsg);// link.ExcuteRetureTable(sql);
        }
    }
}
